package dk.dashboardFP.shapes {
	import flash.display.Sprite;

	/**
	 * @author jk
	 */
	public class DottedLine extends Sprite {
		private var _nWidth : Number;
		private var _uintDotColor : uint;
		private var _nDotRadius : Number;
		private var _nDotSpace : Number;

		public function DottedLine(nWidth:Number, uintDotColor:uint=0x000000, nDotRadius:Number=0.5, nDotSpace:Number=0.5) {
			
			_nDotSpace = nDotSpace;
			_nDotRadius=nDotRadius	;_uintDotColor = uintDotColor;
			_nWidth = nWidth;
			
			drawLine();
		}
		
		private function drawLine() : void {
			
			graphics.beginFill(_uintDotColor, 1);
			
			var intNumDots:int=Math.round(_nWidth / _nDotSpace);
			
			for (var i : int = 0;i < intNumDots; i++) {
				if (_nDotRadius>0.5) {
					graphics.drawCircle(i * _nDotSpace, 0, _nDotRadius);
				} else {
					graphics.drawRect(_nDotSpace*i, 0, 1, 1);
				}
			}
		}
	}
}
